home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 441 / dlibs12 / setbuf.c < prev    next >
C/C++ Source or Header  |  1990-11-23  |  352b  |  21 lines

  1. #include <stdio.h>
  2.  
  3. void setbuf(fp, buf)
  4.     register FILE *fp;
  5.     unsigned char *buf;
  6.     {
  7.     fp->_flag &= ~(_IOFBF | _IOLBF | _IONBF | _IOMYBUF);
  8.     fp->_cnt = 0;
  9.     fp->_ptr = buf;
  10.     if(fp->_base = buf)        /* assignment intentional */
  11.         {
  12.         fp->_flag |= _IOFBF;
  13.         fp->_bsiz = BUFSIZ;
  14.         }
  15.     else
  16.         {
  17.         fp->_flag |= _IONBF;
  18.         fp->_bsiz = 0;
  19.         }
  20.     }
  21.